package com.game.doudizhu.controller;

import com.game.doudizhu.model.GameRoom;
import com.game.doudizhu.repository.CardRepository;
import com.game.doudizhu.service.GameRoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private GameRoomService gameRoomService;
    @Autowired
    private CardRepository cardRepository;


    @GetMapping("/rm_room")
    @Transactional
    public Boolean removeRooms(long id) {
        cardRepository.removeCardsByRoomId(id);
//        return gameRoomService.deleteRoomById(id);
        return true;
    }

}
